<?xml version="1.0" encoding="ISO-8859-1"?>
<#if appConfig.jeeVersion == 3 ><!DOCTYPE web-app PUBLIC
	"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
	"http://java.sun.com/dtd/web-app_2_3.dtd"></#if>
<!--
	
                 Springs On Rails
                 Copyright [2007] [Sunny Liu]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.	
-->
<#if appConfig.jeeVersion &gt;= 5 >
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<#elseif appConfig.jeeVersion == 4 >
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<#else>
<web-app>	
</#if>
	<display-name>Your application display name</display-name>
	<description>Your application description</description>	
	<context-param>
		<param-name>log4jConfigLocation</param-name>
		<param-value>/WEB-INF/log4j.properties</param-value>
	</context-param>
	

	<!--
	  - Location of the XML file that defines the root application context.
	  - Applied by ContextLoaderServlet.		
	  -->
	<context-param>
		<param-name>contextConfigLocation</param-name>		
		<param-value>
			/WEB-INF/dataAccessContext.xml 
			<#if appConfig.viewType == "ws" || appConfig.viewType == "webservice">classpath:org/codehaus/xfire/spring/xfire.xml</#if>
		</param-value>	
	</context-param>

	<!--
	  - Configures Log4J for this web app.
	  - As this context specifies a context-param "log4jConfigLocation", its file path
	  - is used to load the Log4J configuration, including periodic refresh checks.
	  -
	  - Would fall back to default Log4J initialization (non-refreshing) if no special
	  - context-params are given.
	  -
	  - Exports a "web app root key", i.e. a system property that specifies the root
	  - directory of this web app, for usage in log file paths.
	  - This web app specifies "petclinic.root" (see log4j.properties file).
	  -->
	<!-- Leave the listener commented-out if using JBoss -->
	<!--
	<listener>
		<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
	</listener>
	-->
	
	<!--
	  - Loads the root application context of this web app at startup,
	  - by default from "/WEB-INF/applicationContext.xml".
		- Note that you need to fall back to Spring's ContextLoaderServlet for
		- J2EE servers that do not follow the Servlet 2.4 initialization order.
		-
	  - Use WebApplicationContextUtils.getWebApplicationContext(servletContext)
	  - to access it anywhere in the web application, outside of the framework.
	  -
	  - The root context is the parent of all servlet-specific contexts.
	  - This means that its beans are automatically available in these child contexts,
	  - both for getBean(name) calls and (external) bean references.
	  -->
	<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>

	<!--
	  - Spring web MVC servlet that dispatches requests to registered handlers.
	  - Has its own application context, by default defined in "{servlet-name}-servlet.xml",
	  - i.e. "petstore-servlet.xml" in this case.
	  -
	  - A web app can contain any number of such servlets.
	  - Note that this web app has a shared root application context, serving as parent
	  - of all DispatcherServlet contexts.
	  -->
	<servlet>
		<servlet-name>spring</servlet-name>
		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
		<load-on-startup>2</load-on-startup>
	</servlet>

	

	<!--
		- Dispatcher servlet mapping for the main web user interface.
		- Either refering to "petstore" for the Spring web MVC dispatcher.
		-
		-->
	<servlet-mapping>
		<servlet-name>spring</servlet-name>
		<!-- 	Please change me! 		-->
		<url-pattern>/spring/*</url-pattern>
	</servlet-mapping>

	<welcome-file-list>
		<welcome-file>index.jsp</welcome-file>
	</welcome-file-list>

	<!--
	  - Reference to main database.
		- Only needed for JTA (dataAccessContext.xml).
		-->
	<!--
	<resource-ref>
		<res-ref-name>jdbc/demo1</res-ref-name>
		<res-type>javax.sql.DataSource</res-type>
		<res-auth>Container</res-auth>
	</resource-ref>
	-->

	<!--
	  - Reference to database.
		- Only needed for JTA (dataAccessContext.xml).
		-->
	<!--
	<resource-ref>
		<res-ref-name>jdbc/demo2</res-ref-name>
		<res-type>javax.sql.DataSource</res-type>
		<res-auth>Container</res-auth>
	</resource-ref>
	-->

</web-app>
